package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.ImportAndExportSchools;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

public interface ImportAndExportSchoolsRepository extends JpaRepository<ImportAndExportSchools,Integer> {

    @Query(value = "select count(1) from import_and_export_schools where " +
            "student_id =?1 and type = ?2 and DATE_FORMAT(time,'%Y-%m-%d %h:%i:%s')= DATE_FORMAT(?3,'%Y-%m-%d %h:%i:%s')",nativeQuery = true)
    Integer findByDate(Integer valueOf, Integer type, Date date);
}
